﻿using MLSMooc.DAO.Implement.Textbook;
using MLSMooc.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;

namespace MLSMooc.Controllers
{
    public class TextbookController : Controller
    {
        TextbookDAO textbookDAO = TextbookDAO.Getinstance();

        [HttpGet]
        public async Task<string> GetByIdTextbookInfo(string id)
        {
            var res = await textbookDAO.GetByIdTextbookInfo(id);
            return SerializeHelper.SerializeJson(res);
        }

        [HttpGet]
        public async Task<string> GetTextbookAllList()
        {
            var res = await textbookDAO.GetTextbookAllList();
            return SerializeHelper.SerializeJson(res);
        }
    }
}